<script setup lang="ts">
import { px2rem } from '@renderer/utils'
const emit = defineEmits(['click'])

const props = withDefaults(
  defineProps<{
    name: string
    fill?: string
    prefix?: string
    width?: number
    height?: number
  }>(),
  {
    prefix: 'icon',
    fill: '#fff'
  }
)
</script>
<template>
  <svg
    class="svg-icon"
    :style="{ width: px2rem(width as number), height: px2rem(height as number) }"
    v-bind="props"
    @click="emit('click')"
  >
    <use :xlink:href="`#${prefix}-${name}`" v-bind="props"></use>
  </svg>
</template>
<style lang="scss" scoped></style>
